/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package defaultPackage;

/**
 *
 * @author Marcel
 */
public class Vector2 {

    private float x;
    private float y;

    public Vector2(float x, float y) {
        this.x = x;
        this.y = y;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }
    
    public Vector2 add (Vector2 p) {
        return new Vector2( this.x += p.x, this.y += p.y );
    }
    
    public Vector2 subtract (Vector2 p) {
        return new Vector2( this.x -= p.x, this.y -= p.y );
    }
    
    public Vector2 getPoint () {
        return new Vector2(this.x,this.y);
    }
    
    public void setPoint(float x, float y) {
        this.x = x;
        this.y = y;
    }
}
